package com.redis.queue.sub;

import redis.clients.jedis.JedisPubSub;

public class Sub2 extends JedisPubSub {
	public Sub2() {
    }

    public void onMessage(String channel, String message) {
        System.out.println(String.format("消费者2号接收到消息, channel: %s, message: %s", channel, message));
    }

    public void onSubscribe(String channel, int subscribedChannels) {
        System.out.println(String.format("消费者2号订阅成功, channel: %s, subscribedChannels %d", channel, subscribedChannels));
    }
    
    public void onUnsubscribe(String channel, int subscribedChannels) {
        System.out.println(String.format("消费者2号取消订阅, channel: %s, subscribedChannels %d", 
                channel, subscribedChannels));
    }
}
